package com.caochenlei.adapter.objectAdapter;

public class VoltageAdapter implements Voltage5V {
    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        //获取220V交流电
        int output220V = voltage220V.output220V();
        //转换为5V直流电
        int output5V = output220V / 44;

        System.out.println("VoltageAdapter output5V ...");
        return output5V;
    }
}
